package org.se.scut.hibernate.dao;

public class DAOFactory {

	private static  LoginDAO LOGINDAO;
	private static  UserInfoDAO USERINFODAO;
	private static AblumDAO ABLUMDAO;
	private static PictureDAO PICTUREDAO;
	private static CommentDAO COMMENTDAO;
	private static PictureTypeDAO PICTURETYPEDAO;
	
	public static LoginDAO getLoginDAO()
	{
		if (LOGINDAO == null) {
			synchronized (LoginDAO.class) {
				if (LOGINDAO == null) {
					LOGINDAO = new LoginDAO();
				}
			}
		}
		return LOGINDAO;
	}
	
	public static UserInfoDAO getUserInfoDAO()
	{
		if (USERINFODAO == null) {
			synchronized (UserInfoDAO.class) {
				if (USERINFODAO == null) {
					USERINFODAO = new UserInfoDAO();
				}
			}
		}
		return USERINFODAO;
	}
	
	public static AblumDAO getAblumDAO()
	{
		if (ABLUMDAO == null) {
			synchronized (AblumDAO.class) {
				if (ABLUMDAO == null) {
					ABLUMDAO = new AblumDAO();
				}
			}
		}
		return ABLUMDAO;
	}
	
	public static PictureDAO getPictureDAO()
	{
		if (PICTUREDAO == null) {
			synchronized (PictureDAO.class) {
				if (PICTUREDAO == null) {
					PICTUREDAO = new PictureDAO();
				}
			}
		}
		return PICTUREDAO;
	}
	
	public static CommentDAO getCommentDAO()
	{
		if (COMMENTDAO == null) {
			synchronized (CommentDAO.class) {
				if (COMMENTDAO == null) {
					COMMENTDAO = new CommentDAO();
				}
			}
		}
		return COMMENTDAO;
	}
	
	public static PictureTypeDAO getPictureTypeDAO()
	{
		if (PICTURETYPEDAO == null) {
			synchronized (PictureTypeDAO.class) {
				if (PICTURETYPEDAO == null) {
					PICTURETYPEDAO = new PictureTypeDAO();
				}
			}
		}
		return PICTURETYPEDAO;
	}
}
